package com.chixing.util;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component // bean注入到IoC容器   <bean id="logUtil" class="com.chixing.util.LogUtil"></bean>
@Aspect   // 定义切面
public class LogUtil {

    // 切点 ， 增强
    @After("execution(* com.chixing.service..*.save*(..))" +
            " || execution(* com.chixing.service..*.update*(..))" +
            " || execution(* com.chixing.service..*.delete*(..))")
    public void addLog(){
        System.out.println("添加日志》》》》》》》》》》");
    }
}
